﻿using System.Web.Mvc;
using Kaiser.MvcBase.Context;
using Kaiser.MvcBase.ControllerFactory;
using Kaiser.MvcBase.ViewEngines;
using Kaiser.Site;

namespace Kaiser.ManageClient
{
    // 注意: 有关启用 IIS6 或 IIS7 经典模式的说明，
    // 请访问 http://go.microsoft.com/?LinkId=9394801

    public class MvcApplication : System.Web.HttpApplication
    {
        protected void Application_Start()
        {
            ManageContext.Init(new TestUserService());
            ViewEngines.Engines.Clear();
            ViewEngines.Engines.Add(new ThemesRazorViewEngine());

            AreaRegistration.RegisterAllAreas();

            //WebApiConfig.Register(GlobalConfiguration.Configuration);
            //FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            //RouteConfig.RegisterRoutes(RouteTable.Routes);


            UnityInstaller.Install();

          // Facade.Main.FacadeFactory.CreateUserFacade().WebClientPermissionInstall(Assembly.GetExecutingAssembly());

            ControllerBuilder.Current.SetControllerFactory(new UnityControllerFactory());
        }
    }
}